package org.example.liaoxuefeng.templatemethod;

import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;

/**
 * @author: 默苍璃
 * @date: 2024-07-18 18:16
 */
public class GuavaSetting extends AbstractSetting {
    private Cache<String, String> cache = CacheBuilder.newBuilder()
            .maximumSize(1000)
            .build();

    @Override
    protected String lookupCache(String key) {
        return cache.getIfPresent(key);
    }

    @Override
    protected void putIntoCache(String key, String value) {
        cache.put(key, value);
    }
}